package edu.fatec.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class GenericDAO {

	public static Connection getConnection(){
		Connection con = null;
		try{
			String driver = "net.sourceforge.jtds.jdbc.Driver";
			Class.forName(driver);

			String conexao= "jdbc:jtds:sqlserver:";
			String localizacao = "//127.0.0.1:1433;";
			String databaseName = "DatabaseName=LojaVirtual";
			String pipe = "namedPipe = true";

			String endereco = conexao + localizacao + databaseName + pipe;
			String usuario="sa";
			String senha="1234";

			con = DriverManager .getConnection(endereco,usuario,senha);
		}catch(SQLException e){

		}catch (ClassNotFoundException e) {
			// TODO: handle exception
		}catch (Exception e) {
			// TODO: handle exception
		}

		return con;
	}
}
